From 7667c4d8dc1c1fb558942609a0daa277e35fc7e4 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Thu, 13 Aug 2009 16:48:07 +0200 Subject: [PATCH] Fix leaks of clip region and outstanding moves We're never freeing these, do so when destroying. Fixes bug 589877 --- gdk/gdkwindow.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c index 1c1bb32dad..ba4ad63a3b 100644 --- a/gdk/gdkwindow.c +++ b/gdk/gdkwindow.c @@ -329,6 +329,7 @@ static void do_move_region_bits_on_impl (GdkWindowObject *private, static void gdk_window_invalidate_in_parent (GdkWindowObject *private); static void move_native_children (GdkWindowObject *private); static void update_cursor (GdkDisplay *display); +static void gdk_window_region_move_free (GdkWindowRegionMove *move); static guint signals[LAST_SIGNAL] = { 0 }; @@ -1867,6 +1868,25 @@ _gdk_window_destroy_hierarchy (GdkWindow *window, g_object_unref (display->pointer_info.toplevel_under_pointer); display->pointer_info.toplevel_under_pointer = NULL; } + + if (private->clip_region) + { + gdk_region_destroy (private->clip_region); + private->clip_region = NULL; + } + + if (private->clip_region_with_children) + { + gdk_region_destroy (private->clip_region_with_children); + private->clip_region_with_children = NULL; + } + + if (private->outstanding_moves) + { + g_list_foreach (private->outstanding_moves, gdk_window_region_move_free, NULL); + g_list_free (private->outstanding_moves); + private->outstanding_moves = NULL; + } } break; } -- 2.30.2